package com.yzs.exam.repository;

import com.yzs.exam.entity.Question;
import com.yzs.exam.entity.other.KeyValue;
import com.yzs.exam.viewmodel.admin.question.QuestionPageRequestVM;
import com.yzs.exam.viewmodel.student.exam.ExamPaperQuestionsAttrVM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author yzs
 * @create 2021-03-27 15:36
 */
@Repository
@Mapper
public interface QuestionMapper extends BaseMapper<Question> {
    int deleteByPrimaryKey(Integer id);

    int insert(Question record);

    int insertSelective(Question record);

    Question selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Question record);

    int updateByPrimaryKey(Question record);

    List<Question> page(QuestionPageRequestVM requestVM);

    List<Question> selectByIds(@Param("ids") List<Integer> ids);

    Integer selectAllCount();

    List<KeyValue> selectCountByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<Integer> selectQuestionIds(@Param("subjectId")Integer subjectId,@Param("difficultId")Integer difficultId);

    List<Integer> selectNotErrorQuestionIds(ExamPaperQuestionsAttrVM vm);

    List<Question> selectByLevelTypeChapters(@Param("type") Integer type, @Param("chapters") List<Integer> chapters);
}
